home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc Source Code / DocShell / ShellDef.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  10.1 KB  |  306 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ShellDef.h
  3.  
  4.     Contains:    All non-local definitions for the "shell," meaning not
  5.     only the DocShell, but also DraftWindow and the launcher.  The impetus
  6.     for combining previously separate files is to avoid resource id conflicts
  7.     within the shell subsystem and between it an the rest of OpenDoc
  8.     
  9.     Merged from: DfWinDef.h, ODXDef.h, and RlShlDef.h
  10.  
  11.     Owned by: Nick Pilch
  12.  
  13.     Copyright:    © 1994 - 1996 by Apple Computer, Inc., all rights reserved.
  14.  
  15.     Change History (most recent first):
  16.  
  17.          <3>     3/29/96    DM        1334273: rsrc const for new alert 493
  18.          <2>    .03.1996    NP        1307182: Removed STR# index constant.
  19.          <4>    10/31/95    TJ        Made the Splash Screen Non-Modal.#1297413
  20.          <3>    10/26/95    TÇ        1296574 GM:Cannot set default memory
  21.                                     partition size.
  22.          <2>    10/24/95    jpa        1293441: Added more SpaceIsLow alerts.
  23.          <1>     9/29/95    eeh        1287262: first checked in
  24.     
  25.     In Progress:
  26.         
  27. */
  28.  
  29. #ifndef _SHELLDEF_
  30. #define _SHELLDEF_
  31.  
  32. #ifndef _RSRCBASE_
  33. #include "RsrcBase.h"
  34. #endif
  35.  
  36. /*    
  37.     The shell currently uses 41 IDs; 9 more and its range will have to
  38.     be expanded.
  39. */
  40.  
  41. // LDEFs can have the same ID as anything, since having that ID means
  42. // nothing.  (That is, there's no assumption in the code or toolbox like
  43. // the one that DLOG and DITL ids will match.)
  44.  
  45. #define kODShellLDEFRsrcBase    kODShellRsrcBase
  46.  
  47. /*****************************************************************************
  48.     From:        RlShlDef.h
  49.     The constants following are for the DocShell itself
  50. *****************************************************************************/
  51.  
  52. // Do you want to save changes before closing? DLOG
  53. #define    kSHLsvChanges                    (kODShellRsrcBase + 0)                
  54.  
  55. // Revert to the last saved version? DLOG
  56. #define    kSHLsvRevert                    (kODShellRsrcBase + 1)                    
  57.  
  58. // Delete this document? DLOG
  59. #define    kSHLDeleteDLOG                    (kODShellRsrcBase + 2)                    
  60.  
  61. // Error Handling ALRT & errs & STR#
  62. #define    kSHLphGenError                    (kODShellRsrcBase + 3)
  63.  
  64. // Low-memory ALRTs:
  65. #define    kSHLphSpaceIsLow                (kODShellRsrcBase + 4)
  66. #define    kSHLphAppSpaceIsLow                (kODShellRsrcBase + 5)
  67. #define    kSHLphSpaceIsLowNoSave            (kODShellRsrcBase + 31)
  68. #define    kSHLphAppSpaceIsLowNoSave        (kODShellRsrcBase + 32)
  69.  
  70. #define    kODErrUserID                    (kODShellRsrcBase + 6)
  71. #define    kODErrSupportID                    (kODShellRsrcBase + 7)
  72.  
  73. #define    kODErrUserIDStrings                (kODShellRsrcBase + 8)
  74. #define    kODErrSupportIDStrings            (kODShellRsrcBase + 9)
  75.  
  76. // Dragged-to-Trash alert [DISABLED]
  77. // #define kSHLDragToTrashAlert            (kODShellRsrcBase + 10)
  78.  
  79. #define kSHLsvChangesCmdKeyStrs            kSHLsvChanges
  80. #define kSHLsvRevertCmdKeyStrs            kSHLsvRevert
  81. #define kSHLDeleteDLOGCmdKeyStrs        kSHLDeleteDLOG
  82.  
  83. // Save A Copy dialog
  84. #define kSHLSaveCopyDlgID                (kODShellRsrcBase + 11)
  85. #define kSHLSaCDocumentIconID               (kODShellRsrcBase + 12)
  86. #define kSHLSaCStationeryIconID           (kODShellRsrcBase + 13)
  87. #define kSHLSaCDocumentRadioBtn           13
  88. #define kSHLSaCStationeryRadioBtn         14
  89. #define kSHLSaCKindPopupItem              15
  90. #define kSHLSaCDocumentIconItem           16
  91. #define kSHLSaCStationeryIconItem         17
  92.  
  93. #define kSHLSaCKindPopupMenu              (kODShellRsrcBase + 14)
  94.  
  95. // Folder Name strings searching
  96. #define kODEditorsFldrStrID                (kODShellRsrcBase + 15)
  97. #define kODOpenDocPartsFolderStrID        (kODShellRsrcBase + 16)
  98. #define kODShellPlugInFolderStrID        (kODShellRsrcBase + 17)
  99. #define kODStationeryFldrStrID            (kODShellRsrcBase + 18)
  100.  
  101. // Shell Strings STR#
  102. #define kSHLStrsID                        (kODShellRsrcBase + 19)
  103. //#define kSHLStrIndAboutOD                1
  104. /* #define kSHLStrIndMClose                    2        */
  105. /* #define kSHLStrIndMCloseDoc                3        */
  106. #define kSHLStrIndMPartInfo                2
  107. #define kSHLStrIndDSaveACopy            3
  108. #define kSHLStrIndDException            4
  109. #define kSHLStrIndDSaveAs                5
  110.  
  111. // Shell default save a copy string
  112. #define kSHLCopyDefaultStrID            (kODShellRsrcBase + 20)                    
  113.  
  114. // Shell opening pre-OD document name string
  115. #define kSHLPreODDocNameStrID            (kODShellRsrcBase + 21)
  116.  
  117. // Shell new filename construction template
  118. #define kSHLNewFilenameTemplateStrID    (kODShellRsrcBase + 22)
  119.  
  120. // Shell menuitem text construction templates
  121. #define kSHLSaveItemTemplateStrID        (kODShellRsrcBase + 23)
  122. #define kSHLCloseItemTemplateStrID        (kODShellRsrcBase + 24)
  123. #define kSHLDeleteItemTemplateStrID        (kODShellRsrcBase + 25)
  124.  
  125. #define kSHLPlugInErrorStrID            (kODShellRsrcBase + 26)
  126.  
  127.  
  128. // Save To Different Volume dialog
  129. #define kSHLSaveDiffVolDialogID            (kODShellRsrcBase + 27)
  130.  
  131.  
  132. // Private error codes. Before adding more, check ErrorDef.idl to ensure uniqueness.
  133. #define kODErrAllWritableVolumesAreFull           -29826
  134. #define kODErrVolumesIsFull                       -29825
  135. #define kODErrDirectoryNotHaveWriteAccess          -29824
  136. #define kODErrCannotSaveACopyOntoCurrentDoc     -29823
  137. #define kODErrCannotSaveACopyOntoBusyDoc          -29822
  138. #define kODErrSystemVolumeIsFull                   -29821
  139. #define kODErrCouldNotBindForeignDocument        -29820
  140. #define kODErrCannotFindShellPlugInsFolder        -29819
  141. #define kODErrCannotFindSystemEditorsFolder        -29818
  142. #define kODErrCannotFindOpenDocLibrariesFolder    -29817
  143. #define    kODErrEditorLibraryNotFound                -29816
  144. #define kODErrCannotSaveAsOntoBusyDoc            -29815
  145.  
  146. #define    kSHLAboutBoxDlogID                (kODShellRsrcBase + 28)
  147.  
  148.  
  149. /*****************************************************************************
  150.     From:        ODXDef.h
  151.     The constants following are for the launcher part of the "shell"
  152. *****************************************************************************/
  153.  
  154. // ALRT resource IDs
  155. #define kODXErrAlert             (kODShellRsrcBase + 29)
  156. #define    kODXAnonErrAlert        (kODShellRsrcBase + 30)
  157.  
  158. // Prefs file name resource ID
  159. #define kSHLPrefsFileNameResID    (kODShellRsrcBase + 31)
  160. #define kSHLPrefsFolderNameResID (kODShellRsrcBase + 43)
  161.  
  162. #define kPrefFileType        'pref'
  163. // for stationery creation
  164. #define    kEditorFileType        'shlb'
  165. #define    kDocSeedResType        'seed'
  166. #define    kDocSeedResID        1
  167.  
  168. // Document Stub Data                    Document Stub App
  169. // kDocStubRsrcType kDocStubRsrcID0        kcfrgRsrcType    kcfrgID
  170. // kDocStubRsrcType kDocStubRsrcID1        kMainCFMType    kMainCFMPPCID
  171. // kDocStubRsrcType kDocStubRsrcID2        kscszRsrcType    kscszID
  172. // kDocStubRsrcType kDocStubRsrcID3        kMainCFMType     kMainCFM68KID
  173. // kDocStubRsrcType kDocStubRsrcID4        kMainCFMType     kMainCFM68KID1
  174. // kDocStubRsrcType kDocStubRsrcID5        kCODERsrcType    kCODEID0
  175. // kDocStubRsrcType kDocStubRsrcID6        kCODERsrcType     kCODEID1
  176. // kDocStubRsrcType kDocStubRsrcID7        kCODERsrcType    kCODEID6
  177. // kDocStubRsrcType kDocStubRsrcID8        kCODERsrcType     kCODEID7
  178. // kDocStubRsrcType kDocStubRsrcID9        kMainCFMType     kSOMMemCFM68KID
  179. // kDocStubRsrcType kDocStubRsrcID10    kMainCFMType     kSOMMemCFMPPCID
  180. // kSIZERsrcType     kDocStubSIZEID        kSIZERsrcType    kSIZEID
  181. //
  182.  
  183. // for document stub data (e.g. types & ids of the doc stub app resources when stored
  184. // in OpenDoc™ & OpenDoc Shell)
  185. #define    kSIZERsrcType        'SIZE'
  186. #define kDocStubSIZEID        3
  187.  
  188. #define kDocStubRsrcType    'DSDT'    // for Document Stub DaTa, i.e. how these resources
  189.                                     // are actually stored in OpenDoc™ & OpenDoc Shell
  190.                                     // except for the SIZE resource which we keep as
  191.                                     // a SIZE resource for the convenience of editing it
  192.                                     // in Resedit.
  193.                                     
  194. #define kDocStubRsrcID0        0
  195. #define kDocStubRsrcID1        1
  196. #define kDocStubRsrcID2        2
  197. #define kDocStubRsrcID3        3
  198. #define    kDocStubRsrcID4        4
  199. #define    kDocStubRsrcID5        5
  200. #define    kDocStubRsrcID6        6
  201. #define    kDocStubRsrcID7        7
  202. #define    kDocStubRsrcID8        8
  203. #define    kDocStubRsrcID9        9
  204. //#define    kDocStubRsrcID10    10
  205.  
  206. // for document stub construction
  207. #define    kMainCFMType        'rseg'  // used to be 'DSTB' for Document STuB
  208.                                     // but CFM68K uses 'rseg'.
  209. #define    kMainCFM68KID        0
  210. #define    kMainCFM68KID1        1
  211. #define    kMainCFMPPCID        2
  212. #define kSOMMemCFM68KID        3
  213. #define kSOMMemCFMPPCID        4
  214.  
  215. #define kcfrgRsrcType        'cfrg'
  216. #define kcfrgID                0
  217. #define    kscszRsrcType        'scsz'
  218. #define kscszID                0
  219.  
  220. #define kDocStubStackSize    (64 * 1024)        // 64K stack size
  221.  
  222. // Note: the following two constants are duplicated in Info.cpp!
  223. // Be sure to keep them in sync.
  224. // 1242449 Should probably create a common ≈def.h constant kDocStubMinHeapSize
  225. // accessible from both subsystems.
  226. #define    kDocStubMinHeapSize    (256 * 1024)    // 256K min app heap
  227. #define    kDocStubDefaultSize    (384 * 1024)    // 384K default app heap
  228.  
  229. #define kCODERsrcType        'CODE'
  230. #define kCODEID0            0
  231. #define kCODEID1            1
  232. #define kCODEID6            6
  233. //#define kCODEID7            7
  234.  
  235. #define    kSIZEID                -1
  236.  
  237. // Strings for the Launcher
  238. #define    kODXLibsFldrStrID        (kODShellRsrcBase + 32)
  239. #define kODXLibsFldrStrIndex    1
  240.  
  241. #define kLaunchFailedErrStrings    (kODShellRsrcBase + 33)
  242.  
  243.  
  244. /*****************************************************************************
  245.     From:        DfWinDef.h
  246.     The constants following are for the Draft Window part of the shell
  247. *****************************************************************************/
  248.  
  249. /* DLOG IDs */
  250. #define kDraftsDlgID            (kODShellRsrcBase + 34)
  251. #define kCreateDraftsDlgID        (kODShellRsrcBase + 35)
  252. #define kDeleteDraftsDlogID        (kODShellRsrcBase + 36)
  253.  
  254. /* 'STR ' IDs */
  255. #define kDraftsWnTitleResID        (kODShellRsrcBase + 37)
  256. #define kDraftsWnDateSpaceResID    (kODShellRsrcBase + 38)
  257.  
  258. /* LDEF stuff */
  259. #define kDWNumColumns 4
  260. #define kDraftWinLDEFID            (kODShellLDEFRsrcBase + 0)        
  261. #define kDraftWinLDEFAddrOffset    0x00000008
  262.  
  263. /* fields in Drafts dialog */
  264. #define kDraftsCreateBtn            1
  265. #define kDraftsDoneBtn                2
  266. #define kDraftsDeleteBtn            3
  267. #define kDraftsOpenBtn                4
  268. #define kDraftsCreatorStaticTxt        5
  269. #define kDraftsDraftStaticTxt        6
  270. #define kDraftsCreatedStaticTxt        7
  271. #define kDraftsArrowStaticTxt        8            /* a null string */
  272. #define kDraftsCommentStaticTxt        9
  273. #define kDraftsHeaderRectUserItem    10
  274. #define kDraftsHorizRectUserItem    11
  275. #define kDraftsListUserItem            12
  276. #define kDraftsCreateUserItem        13
  277. #define kDraftsDoneUserItem            14
  278.  
  279. #define kDraftsCmdKeyStrs            (kODShellRsrcBase + 39)
  280. #define kDraftsCreateCmdKeyStrs        (kODShellRsrcBase + 40)
  281.  
  282. /* fields in Create Drafts dialog */
  283. #define kCreateDraftsCreateBtn            1
  284. #define kCreateDraftsCancelBtn            2
  285. #define kCreateDraftsDraftStaticTxt        3
  286. #define kCreateDraftsNameStaticTxt        4
  287. #define kCreateDraftsNameEditTxt        5
  288. #define kCreateDraftsCommentsStaticTxt    6
  289. #define kCreateDraftsCommentsEditTxt    7
  290. #define kCreateDraftsDraftEditTxt        8
  291.  
  292. /* fields in Delete Drafts dialog */
  293. #define kDeleteDraftsDeleteBtn            1
  294. #define kDeleteDraftsCancelBtn            2
  295. #define kDeleteDraftsStaticTxt            3
  296.  
  297. #define    kDWClosedTriangleResID        (kODShellRsrcBase + 41)
  298. #define    kDWOpenTriangleResID        (kODShellRsrcBase + 42)
  299.  
  300. #define kODAlertShellLowMemoryError (kODShellRsrcBase + 43)
  301.  
  302.  
  303. #endif    /* _SHELLDEF_ */
  304.  
  305. /*The Splash Screen Dialog ID */
  306. #define kODSplashDlogID                    131